package com.yc.fav.servlet;

import com.yc.base.servlet.BaseServlet;
import com.yc.base.vo.Result;
import com.yc.fav.service.impl.TagFavServiceImpl;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;

@WebServlet("/tagFav/*")
public class TagFavServlet extends BaseServlet {

    public Object moveFav(HttpServletRequest request,
                          HttpServletResponse response)
        throws ServletException, IOException {
        String oldTid = request.getParameter("oldTid");
        String newTid = request.getParameter("newTid");
        String[] fids = request.getParameterValues("fid");
        TagFavServiceImpl service = new TagFavServiceImpl();
        service.moveFav(oldTid,newTid,fids);
        return Result.ok("合并分类成功!");
    }

}
